package model.emp;

import java.sql.SQLException;
import java.util.List;

import com.ibatis.sqlmap.client.SqlMapClient;

public class EmpDao {

	private SqlMapClient sqlMapClient;
	public void setSqlMapClient(SqlMapClient sqlMapClient){
		this.sqlMapClient=sqlMapClient;
	}
	
	public EmpVO login(EmpVO vo) throws SQLException {
		System.out.println((EmpVO) sqlMapClient.queryForObject("emp.login",vo));
		return (EmpVO) this.sqlMapClient.queryForObject("emp.login",vo);
	}
	
	public List getAllEmpList() throws SQLException {
		return this.sqlMapClient.queryForList("emp.getAllEmpList");
	}

	public int nextNo() throws SQLException {
		return (int) this.sqlMapClient.queryForObject("emp.nextNo");
	}

	public void addEmp(EmpVO evo) throws SQLException {
		this.sqlMapClient.insert("emp.addEmp",evo);
	}
	public void delEmp(String delNo) throws SQLException {
		this.sqlMapClient.delete("emp.delEmp",delNo);
	}
}
